<script setup lang="ts">
import { computed } from "vue";
import ApplyResult from "./ApplyResult.vue";

import { TMerchantInfo } from "@/global";

const { data } = defineProps<{
  data: TMerchantInfo;
}>();

const config = {
  0: {
    statusTitle: "您的资料已提交成功",
    statusText: "请耐心等待审核哦",
  },
  2: {
    statusTitle: "很抱歉～",
    statusText: "您的入驻申请暂时无法通过",
  },
  1: {
    statusTitle: "恭喜您已入驻！",
    statusText: "戳戳可看详情哦！"
  },
};


const view = computed(() => {
  const status = data?.audit_status || 0;
  return config[status];
});
</script>

<template>

  <ApplyResult :status="data?.audit_status"
               :title="view.statusTitle"
               :desc="view.statusText"
               :tip="data?.audit_reason" />

</template>
